<template>
    <div id="app">
      <el-form ref="add-Emp" :model="emp" label-width="100px">
        <el-form-item label="姓名">
          <el-input v-model="emp.name" placeholder="请输入名称"></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input v-model="emp.pwd"></el-input>
        </el-form-item>

        <el-form-item label="电话">
          <el-input v-model="emp.tel" ></el-input>
        </el-form-item>

        <el-form-item label="描述">
          <el-input v-model="emp.description"  type="textarea" rows="5"></el-input>
        </el-form-item>
        <el-form-item label="角色">
          <el-select v-model="emp.role" placeholder="请选择">
            <el-option
              label="管理员"
              value="1">
            </el-option>
            <el-option
              label="销售经理"
              value="2">
            </el-option>
            <el-option
              label="销售人员"
              value="3">
            </el-option>
          </el-select>
        </el-form-item>


        <el-form-item>
          <el-button type="primary" @click="save()">提交</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
      data(){
        return {
          emp:{}
        }
      },
      methods:{
        save(){
          //发出ajax请求
          this.axios.post("/emp/add",this.emp).then((resp)=>{
            this.$router.push("/emp/EmpList");
          })
        }
      }
    }
</script>


<style scoped>

</style>
